package com.sample.library.test
//
//import android.os.Bundle
//import android.util.Log
//import android.view.View
//import android.widget.Button
//import android.widget.Toast
//import androidx.appcompat.app.AppCompatActivity
//import com.lxj.xpopup.XPopup
//import com.lxj.xpopupext.listener.CityPickerListener
//import com.lxj.xpopupext.listener.TimePickerListener
//import com.lxj.xpopupext.popup.CityPickerPopup
//import com.lxj.xpopupext.popup.TimePickerPopup
//import com.sample.wanandroidx.R
//import java.util.*
//
//class XpopupExtActivity : AppCompatActivity() {
//    override fun onCreate(savedInstanceState: Bundle?) {
//        super.onCreate(savedInstanceState)
//        setContentView(R.layout.activity_xpopup_ext)
//
//        findViewById<Button>(R.id.btnTimer).setOnClickListener {
//
//            val calendar: Calendar = Calendar.getInstance()
//            calendar.set(2000, 5, 1)
//
//            val calendar2: Calendar = Calendar.getInstance()
//            calendar2.set(2022, 2, 2)
//
//            val popup = TimePickerPopup(this@XpopupExtActivity).setMode(TimePickerPopup.Mode.YMD)
//                .setDefaultDate(Calendar.getInstance())  //设置默认选中日期
//                .setYearRange(1990, 2022) //设置年份范围
//                .setDateRang(calendar, calendar2) //设置日期范围
//                .setTimePickerListener(object : TimePickerListener {
//                    override fun onTimeChanged(date: Date?) {
//                        //时间改变
//                        //Toast.makeText(this@XpopupExtActivity, "选择的时间：" + date?.toLocaleString(), Toast.LENGTH_SHORT).show()
//                    }
//
//                    override fun onTimeConfirm(date: Date, view: View?) {
//                        //点击确认时间
//                        Toast.makeText(this@XpopupExtActivity, "选择的时间：" + date.toLocaleString(), Toast.LENGTH_SHORT).show()
//                    }
//                })
//
//            XPopup.Builder(this@XpopupExtActivity).asCustom(popup).show()
//
//        }
//        findViewById<Button>(R.id.btnCity).setOnClickListener {
//
//            val popup = CityPickerPopup(this@XpopupExtActivity)
//            popup.setCityPickerListener(object : CityPickerListener {
//                override fun onCityConfirm(province: String, city: String, area: String, v: View?) {
//                    Log.e("tag", "$province - $city - $area")
//                    Toast.makeText(this@XpopupExtActivity, "$province - $city - $area", Toast.LENGTH_SHORT).show()
//                }
//
//                override fun onCityChange(province: String, city: String, area: String) {
//                    Log.e("tag", "$province - $city - $area")
//                    //Toast.makeText(this@XpopupExtActivity, "$province - $city - $area", Toast.LENGTH_SHORT).show()
//                }
//            })
//            XPopup.Builder(this@XpopupExtActivity).asCustom(popup).show()
//        }
//    }
//}